I have read a lot of help to understand the quotename function, as shown in the following example.Quotename (TRANSACT-SQL)
Returns a unicode string with delimiters. Adding delimiters can make the input string a valid Microsoft SQL Server 2005
First, the identifiers in sqlserver have certain rules. For example, if your createtableabc123 (...) contains spaces, it does not comply with the rules. You will write createtable [abc123] (...) to define the identifier using. Quotename makes the
SyntaxUse CAST:
CAST (expression AS data_type)
Use CONVERT:
CONVERT (data_type [(length)], expression [, style])
ParametersExpression
Is any valid Microsoft SQL Server "expression. For more information, see expressions.
Data_type
The data types
GrammarUse CAST:
CAST (expression as data_type)
Use CONVERT:
CONVERT (data_type[(length)], expression [, style])
ParametersExpression
Is any valid Microsoft SQL Server expression. For more information, see expressions.
Data_type
The data
Explicitly converts a data type expression to another data type. CAST and CONVERT provide similar functions.
Explicitly converts a data type expression to another data type. CAST and CONVERT provide similar functions.
SyntaxUse CAST:
CAST
The SQL injection vulnerability attacks have aroused widespread concern because they can penetrate the firewall and Intrusion Detection System to damage your data layer. Whether it is the first or second-level injection attack, if you look at the
Recently, due to the ERP project, we need to know which tables and columns of the background database are written in the Application Operation of the Foreground Data Import function.
Recently, due to the ERP project, we need to know which tables and
For example: We import a customer's information, we know that the customer's name is Zhangshan, we want to know, in our business database (Eg:northwind), which of the data tables which fields set the name value Zhangshan, through the following SQL,
PS: From the BLOG of heige, we can see that the problem lies in QUOTENAME () and REPLACE (). I jumped to Microsoft and found it.
Injection enabled by data TruncationIf any dynamic Transact-SQL statement assigned to a variable is larger than the
Hello everyone
I have a table named studentMark student orders.
Its structure is:
Auto-increment ID, student ID, subject ID, score, exam time, Exam ID
ID (int), StudentID (int), Kind (int), Mark (float), TestTime (DateTime), TestKindID (int)
1, 20
In order to improve development efficiency, it is necessary to generate a fixed-format interface, for example, to provide new/modified/delete/Read interfaces:Take the common table structure for example, the special table structure can try to adjust
In SQL Server, there are times when you need to give some logins (users) permission to view all or part of the objects (stored procedures, functions, views, tables) that define permissions to save. If a partial stored procedure, function, view is
If exists (select * From DBO. sysobjects where id = object_id (n' [DBO]. [p_toidentity] ') and objectproperty (ID, n' isprocedure') = 1)Drop procedure [DBO]. [p_toidentity]Go
/* -- Convert a common column to an ID column
Modify the table name and
Data | database
/*--Original post address: http://community.csdn.net/expert/topic/3818/3818559.xml?temp=.9593317--*/
/*--Processing Requirements
There is a database named Pos200502 in the SQL databases, and each month there will be a database
/* -- The method for resolving strings that cannot exceed 8000
It is often mentioned that when data is processed using the dynamic generation of SQL statements, the processing statements are too long and cannot be processed.This issue is discussed
Copy codeThe Code is as follows:-- Exchange of rows and columns/*************************************** **************************************** **************************************** *******************************Take student scores as an
Copy Code code as follows:
--The ranks turn
/************************************************************************************************************** ****************************************
Take the student achievement as the example,
Problem Description: A basic information table, with more than 30 tables in the system, there is a foreign key relationship, when the basic data to delete, you need to determine whether has been used, if used to change the flag, if not used to
Column-to-row conversion is classic. For more information, see.
Column-to-row conversion is classic. For more information, see.
The Code is as follows:
-- Exchange of rows and columns
/*************************************** ************************
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.